/*
 * @Author: taiyunhang
 * @Date: 2018-12-12 11:18:40
 * */

import Vue from 'vue';
import VueRouter from 'vue-router';
import { staticPath, routerMode } from '@/env';

import Login from '@/views/login/login.vue';
import Home from '@/views/home/home.vue';
import Point from '@/views/point/point.vue';
import Order from '@/views/order/order.vue';
import Activity from '@/views/activity/activity.vue';
import Personal from '@/views/personal/personal.vue';
import Pay from '@/views/pay/pay.vue';
import Qiang from '@/views/qiang/qiang.vue';

Vue.use(VueRouter);

const routes = [
  /* {
    path: '/',
    redirect: { name: 'home' }
  }, */
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/point',
    name: 'point',
    component: Point
  },
  {
    path: '/order',
    name: 'order',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: Order
  },
  {
    path: '/activity',
    name: 'activity',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: Activity
  },
  {
    path: '/personal',
    name: 'personal',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: Personal
  },
  {
    path: '/pay',
    name: 'pay',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: Pay
  },
  {
    path: '/qiang',
    name: 'qiang',
    component: Qiang
  },
];

export default new VueRouter({
  base: staticPath,
  mode: routerMode,
  routes: routes
});
